import {
	getMockUserDetail,
	getMockStages
} from '@/utils/mock'
import { isMock } from '../config/env'
/**
 * 获取用户详情（mock）
 * @param {string} id
 * @returns {Promise<{ user: Object, stages: Array }>}
 */
// export function fetchMockDetail(id) {
// 	return new Promise((resolve) => {
// 		setTimeout(() => {
// 			const user = getMockUserDetail(id)
// 			const stages = getMockStages()
// 			resolve({
// 				user,
// 				stages
// 			})
// 		}, 300) // 模拟延迟
// 	})
// }

export async function fetchRealDetail(id) {
	const res = await uni.request({
		url: `http://10.18.36.107:8880/api/v1/game/progress/1/${id}`,
		method: 'GET'
	})
	console.log(res.data.character)
	return {
		user: res.data.character,
		stages: res.data.themes
	}
}
